package cn.westv.scps.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.GenericGenerator;

@Entity(name = "owner_feedback")
public class OwnerFeedbackEntity implements Serializable{

	private String id;
	private String content;//反馈内容
	private Date feedbackTime;//反馈时间
	private String feedbackAccount;//反馈人
	
	@Id
	@Column(name = "id", nullable = false, length = 32)
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	@Basic
	@Column(name = "content", nullable = true, length = 1024)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@Basic
	@Column(name = "feedback_time", nullable = true)
	public Date getFeedbackTime() {
		return feedbackTime;
	}
	public void setFeedbackTime(Date feedbackTime) {
		this.feedbackTime = feedbackTime;
	}
	
	@Basic
	@Column(name = "feedback_account", nullable = true, length = 16)
	public String getFeedbackAccount() {
		return feedbackAccount;
	}
	public void setFeedbackAccount(String feedbackAccount) {
		this.feedbackAccount = feedbackAccount;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((content == null) ? 0 : content.hashCode());
		result = prime * result + ((feedbackAccount == null) ? 0 : feedbackAccount.hashCode());
		result = prime * result + ((feedbackTime == null) ? 0 : feedbackTime.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OwnerFeedbackEntity other = (OwnerFeedbackEntity) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (feedbackAccount == null) {
			if (other.feedbackAccount != null)
				return false;
		} else if (!feedbackAccount.equals(other.feedbackAccount))
			return false;
		if (feedbackTime == null) {
			if (other.feedbackTime != null)
				return false;
		} else if (!feedbackTime.equals(other.feedbackTime))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	
	
}
